<?php

/**
 * Update category block
 *
 * @category   TinDat
 * @package    TinDat_Update
 * @author     TinDat <magentoworks.net@gmail.com>
 */
class TinDat_Update_Block_Adminhtml_Category_Update extends TinDat_Update_Block_Adminhtml_Update
{

	public function getTitle($type) {
		$types = array(
			'categories' => $this->__('Update Categories'),
			'attributes' => $this->__('Update Category Attributes')
		);
		if (isset($types[$type])) return $types[$type];
		return '';
	}

	public function getFilePath() {
		return 'var' . DS . 'update' . DS . 'category';
	}

	public function getFileName($type) {
		$types = array(
			'categories' => 'categories.csv',
			'attributes' => 'attributes.csv'
		);
		if (isset($types[$type])) 
                    return $types[$type];
		return '';
	}

	public function showExportInfo($type) 
        {
		return $this->getLayout()->createBlock('tindat_update/adminhtml_category_update')
				->setTemplate('update/category/'.$type.'.phtml')
				->toHtml();
	}

	public function getAttributes() {
		return $this->helper('tindat_core/category')->getAttributes();
	}

}
